#include <iostream>
using namespace std;
const int BUFFER_SIZE = 32;
/*无参构造函数想要调用有参构造函数必须使用初始化列表*/
class Person
{
public:
    long m_age1;
    long m_age2;
    long m_age3;
    long m_age4;
    long m_age5;
    long m_age6;
    long m_age7;
    long m_age8;
    long m_age9;
    long m_age0;
};
#if 0
/*虚继承*/
class Worker : virtual public Person
{
public:
    long m_salary;
};
#else
/*直接继承*/
class Worker : public Person
{
public:
    long m_salary;
};
#endif
#if 0
/*虚继承*/
class Student : virtual public Person
{
public:
    long m_score;
};
#else
/*直接继承*/
class Student : public Person
{
public:
    long m_score;
};
#endif
class Undergrauate : public Worker, public Student
{
public:
    long m_grade;
};
int main()
{
    /*子类的内存顺序是根据继承的顺序而不是程序顺序*/
    Undergrauate ug;
    int len = sizeof(ug);
    cout << len << endl;

    return 0;
}